package com.example.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.entity.Legalperson;
import com.example.entity.ZPerson;
import com.example.util.page;
import com.example.util.page3;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tyhxzy
 * @since 2023-11-03
 */
public interface LegalpersonMapper extends BaseMapper<Legalperson> {

    Page<Map> findByParams(Page p1, @Param("xx") page3 legalperson);
    Legalperson selectByid(Integer id);
    @SelectKey(keyColumn = "id", keyProperty = "id", statement = "select last_insert_id()", before = false, resultType = Integer.class)
    @Insert("update legalperson set name=#{name},idcard=#{idNumber},validity=#{validity},invalid=#{invalid} where zid=#{zid}")
    int add(ZPerson z);

    @Insert("update legalperson set zmz=#{zmz} where zid=#{zid}")
    int addzIdCard(Legalperson legalperson);
    @Insert("update legalperson set fmz=#{fmz} where zid=#{zid}")
    int addfIdCard(Legalperson legalperson);
    //初始化
    @Insert("insert into legalperson(zid,status) value(#{zid},18)")
    int addZid(Integer zid);




}
